// Copyright (c) 2013 The Foundry Visionmongers Ltd. All Rights Reserved.

#ifndef PLUGIN_H
#define PLUGIN_H

#include "utils.h"

#include <Render/RenderBase.h>

namespace FnKat = Foundry::Katana;


class PbrtRenderPlugin : public FnKat::Render::RenderBase
{
public:

    PbrtRenderPlugin(FnKat::FnScenegraphIterator rootIterator,
                         FnKat::GroupAttribute arguments);
    ~PbrtRenderPlugin();

    // Render Control

    int start();

    int pause();

    int resume();

    int stop();

    // Interactive live updates

    int startLiveEditing();

    int stopLiveEditing();

    int processControlCommand(const std::string& command);

    int queueDataUpdates(FnKat::GroupAttribute updateAttribute);

    int applyPendingDataUpdates();

    bool hasPendingDataUpdates() const;

    // Disk Render

    void configureDiskRenderOutputProcess(FnKat::Render::DiskRenderOutputProcess& diskRenderOutputProcess,
                                          const std::string& outputName,
                                          const std::string& outputPath,
                                          const std::string& renderMethodName,
                                          const float& frameTime) const;

    // Plugin Interface

    static Foundry::Katana::Render::RenderBase* create(FnKat::FnScenegraphIterator rootIterator, FnKat::GroupAttribute args)
    {
        return new PbrtRenderPlugin(rootIterator, args);
    }

    static void flush()
    {

    }

    static std::string hostAddress;
    static float frameTime;

private:

    Scene *initScene( FnKat::Render::RenderSettings &renderSettings );

};

/**
 * @}
 */


#endif
